﻿using Domain.User;
using MediatR;
using MES.Server.API.Dto.Account;
using Microsoft.AspNetCore.Mvc.Rendering;
using ReturnValue;

namespace MES.Server.API.Application.Command.Account.DocumentCodeRuleCommand
{
    /// <summary>
    /// 创建编码规则命令
    /// </summary>
    public class CreateDocumentCodeRuleCommand : IRequest<ApiResult<DocumentCodeRule>>
    {
        public string BusinessEntity { get; set; }
        public string RuleName { get; set; }
        public string EntityField { get; set; }
        public string DateField { get; set; }
        public string Prefix { get; set; }
        public string RuleType { get; set; }
        public int NumberDigits { get; set; }
        public string GrowthType { get; set; }
        public string Connector { get; set; }
    }

    /// <summary>
    /// 查询编码规则命令
    /// </summary>
    public class GetDocumentCodeRulesCommand : IRequest<ApiPaging<DocumentCodeRule>>
    {
        public string? BusinessEntity { get; set; }
        public string? RuleName { get; set; }
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 20;
    }
    /// <summary>
    /// 更新编码规则命令
    /// </summary>
    public class UpdateDocumentCodeRuleCommand : IRequest<ApiResult<DocumentCodeRule>>
    {
        public long Id { get; set; }
        public string BusinessEntity { get; set; }
        public string RuleName { get; set; }
        public string EntityField { get; set; }
        public string DateField { get; set; }
        public string Prefix { get; set; }
        public string RuleType { get; set; }
        public int NumberDigits { get; set; }
        public string GrowthType { get; set; }
        public string Connector { get; set; }
    }

    /// <summary>
    /// 删除编码规则命令
    /// </summary>
    public class DeleteDocumentCodeRuleCommand : IRequest<ApiResult<object>>
    {
        public long Id { get; set; }
    }
}
